home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / DB_CLIPP / 0769B.ZIP / CLIPSCR2.ASM < prev    next >
Assembly Source File  |  1987-10-23  |  3KB  |  122 lines

  1. ;    Title:    CLIPSCR2.ASM
  2. ;    Author:    James J. Orlowski, M.D.
  3. ;               John Willis
  4. ;    Ideas:  Suggested by scrolling routines in 
  5. ;               ROLLSCRN.ASM by F. Ho written in 1985 and in public domain
  6. ;    Date:    03/87
  7. ;    Syntax:    DO BOXCLS WITH TOP, LEFT, BOTTOM, RIGHT, ATTR, LINES, DIR
  8. ;    Note:    - rolls CLEAR the box on the screen between
  9. ;          the coordinates TOP, LEFT to BOTTOM, RIGHT 
  10. ;                 and sets background attribute to ATTR
  11. ;                 Can be used to roll screen LINES between 1 and 24
  12. ;                 But if LINES = 0 then clears box
  13. ;                 and DIRection 6 = up or 7 = down
  14. public    BOXCLS                ;
  15. ;
  16. extrn    _PARNI:far            ; declare as external of type far
  17. extrn    _RET:far            ;
  18. ;
  19. ;
  20. datasg    segment    para    'DATA'        ; start of data segment
  21. ;
  22. TOP        db    0h        ; top -
  23. LEFT    db    0h            ; left corner
  24. BOTTOM    db    0h            ; bottom -
  25. RIGHT    db    0h            ; right corner
  26. ATTR    db      0h                      ; attribute number
  27. LINES   db      0h                      ; number of lines to scroll up
  28. DIR     db      0h                      ; direction: 6 = up, 7 = down
  29. ;
  30. datasg    ends                ; end of data segment
  31. ;
  32. ;
  33. _prog    segment    byte            ; start of code segment
  34. assume    cs:_prog,ds:datasg,es:_prog
  35. ;
  36. BOXCLS     proc    far            ; start of BOXCLS process
  37.         push    bp        ; preserve return address
  38.         mov    bp,sp
  39.  
  40.         push    ds        ; save registers
  41.         push    es        ;
  42.  
  43.         mov    ax,1        ; take 1st para
  44.         push    ax
  45.         call    _PARNI
  46.         add    sp,2        ; restore stack
  47.         mov    TOP,al        ; assign 1st para to TOP
  48.  
  49.         mov    ax,2        ; take 2nd para
  50.         push    ax
  51.         call    _PARNI
  52.         add    sp,2
  53.         mov    LEFT,al        ; assign to LEFT
  54.     
  55.         mov    ax,3        ; take 3rd para
  56.         push    ax
  57.         call    _PARNI
  58.         add    sp,2
  59.         mov    BOTTOM,al    ; assign to BOTTOM
  60.  
  61.         mov    ax,4        ; take 4th para
  62.         push    ax
  63.         call    _PARNI
  64.         add    sp,2
  65.         mov    RIGHT,al    ; assign to right
  66.  
  67.         mov    ax,5        ; take 5th para
  68.         push    ax
  69.         call    _PARNI
  70.         add    sp,2
  71.         mov    ATTR,al        ; assign to ATTR
  72.  
  73.         mov    ax,6        ; take 6th para
  74.         push    ax
  75.         call    _PARNI
  76.         add    sp,2
  77.         mov    LINES,al    ; assign to LINES
  78.  
  79.         mov    ax,7        ; take 7th para
  80.         push    ax
  81.         call    _PARNI
  82.         add    sp,2
  83.         mov    DIR,al        ; assign to DIR
  84.  
  85.         push    cx        ; preserve coordinate
  86.         push    dx        ; registers
  87.  
  88.         mov    ch,TOP        ; assign TOP to high CX
  89.         mov    cl,LEFT        ; assign LEFT to low CX
  90.         mov    dh,BOTTOM    ; assign BOTTOM to high DX
  91.         mov    dl,RIGHT    ; assign RIGHT to low DX
  92.  
  93.         xor    ax,ax        ; zero out AX
  94.         push    ax
  95.         mov    ah,DIR      ; assign DIR to high AX
  96.         mov    al,LINES    ; assign LINES to low AX
  97.                                         ; ah = ROM-BIOS Video Service #
  98.         mov    bh,ATTR         ; assign ATTR to bh
  99.                 shl     bh,1            ; bh register to shift left 4 times
  100.                 shl     bh,1            ; to multiply by 16 to convert
  101.                 shl     bh,1            ; to background attribute
  102.                 shl     bh,1            
  103.  
  104.         int    10h        ; issue video int
  105.  
  106.         pop    ax        ; restore registers
  107.         pop    dx        ; before calling RETs
  108.         pop    cx           
  109.  
  110.         pop    es           
  111.         pop    ds           
  112.         pop    bp           
  113.  
  114.         call    _RET        ; Clipper return (actual cleaning)
  115.  
  116.         ret            ; actual physical return
  117. BOXCLS endp                ; end of process
  118. ;
  119. _prog    ends
  120.         end
  121.  
  122.